#include "CApp.h"

#include <string>
#include <sstream>
 
void CApp::OnRender() {

	int y_pos = 300;

	CSurface::OnDraw(Surf_Display, Bkgrnd_bmp, 0, 0);

	CSurface::OnDraw(Surf_Display, Surf_Test, x_pos,y_pos, 135,239, 21, 15);

	for(int i=0; i<NO_OF_YOSHIS; /*number of objects*/ i++)
	{
		Yoshi_objects[i]->OnRender(Surf_Display);
	}

	// ---------- Display fps -------------
	// Calc frameTime
	frmCnt.OnRender(Surf_Display);
	SDL_Surface *text;
	SDL_Color text_color = {255, 255, 255};
	
	std::stringstream ss;
	ss << frmCnt.GetAvgNoOfFrames();
	ss << " fps";

	//TTFtext = TTF_RenderText_Solid(font,ss.str().c_str(), text_color);
	//CSurface::OnDraw(Surf_Display,text,5,450);
 
    // Display the new surface
	SDL_Flip(Surf_Display);

	
}